package com.example.blogapi.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
@AllArgsConstructor
@ApiModel("页数信息实体")
public class Result {
    @ApiModelProperty("是否成功获取信息")
    private boolean success;
    @ApiModelProperty("响应状态码")
    private int code;
    @ApiModelProperty("响应信息")
    private String msg;
    @ApiModelProperty("响应数据")
    private Object data;

    public static Result success(Object data){
        return new Result(true,200,"success",data);
    }
    public static Result fail(int code,String mes){
        return new Result(false,code,mes,null);
    }
}
